import pandas as pd
from sklearn.svm import SVC
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline

x = pd.read_csv("D:\分类实验2次\\new_titanic.csv", usecols=['Pclass','Sex','Age','SibSp','Parch','Fare','Embarked'])
y = pd.read_csv("D:\分类实验2次\\new_titanic.csv", usecols=['Survived'])

#knn
neigh = KNeighborsClassifier(n_neighbors=3)
neigh.fit(x, y)

#svm
svm = make_pipeline(StandardScaler(), SVC(gamma='auto'))
svm.fit(x, y)

#GaussianNB
clf = GaussianNB()
clf.fit(x, y)